package com.hjlh.aimedical.common.respone;

import java.io.Serializable;


public class ResultModel implements Serializable {

    Integer code;

    String msg;

    private Object content;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getContent() {
        return content;
    }

    public void setContent(Object content) {
        this.content = content;
    }

    public ResultModel() {
    }

    public static ResultModel success() {
        return new ResultModel(ResultStatus.RESULT_STATUS_SUCCESS.getValue());
    }

    public ResultModel(Integer code) {
        this.code = code;
    }

    public static ResultModel success(String msg, Object content) {
        return new ResultModel(ResultStatus.RESULT_STATUS_SUCCESS.getValue(),msg, content);
    }

    public static ResultModel fail() {
        return new ResultModel(ResultStatus.RESULT_STATUS_FAILURE.getValue());
    }

    public static ResultModel fail(String msg, Object content) {
        return new ResultModel(ResultStatus.RESULT_STATUS_FAILURE.getValue(),msg, content);
    }

    public ResultModel(Integer code, String msg, Object content) {
        this.code = code;
        this.msg = msg;
        this.content = content;
    }
}
